package com.alipay.mapper;

import com.alipay.pojo.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.context.annotation.ComponentScan;

import java.util.List;

@ComponentScan
@Mapper
public interface UserInfoMapper {
    /**
     * delete by primary key
     *
     * @param userId primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Integer userId);

    /**
     * insert record to table
     *
     * @param record the record
     * @return insert count
     */
    int insert(UserInfo record);

    /**
     * insert record to table selective
     *
     * @param record the record
     * @return insert count
     */
    int insertSelective(UserInfo record);

    /**
     * select by primary key
     *
     * @param userId primary key
     * @return object by primary key
     */
    UserInfo selectByPrimaryKey(Integer userId);

    /**
     * update record selective
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(UserInfo record);

    /**
     * update record
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(UserInfo record);

    UserInfo userLogin(@Param("username") String username, @Param("password") String password);

    List<UserInfo> selectUserInfo(@Param("userId") Integer userId,
                                  @Param("phoneNumber") Integer phoneNumber,
                                  @Param("status") Boolean status);
}
